package com.xframe.domain.e3sp.basedata;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.xframe.domain.BaseModel;
import com.xframe.domain.e3sp.maindata.SparePartBaseView;
import com.xframe.xdal.core.annotation.*;
import com.xframe.xdal.core.constant.AutoFillType;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.Date;

/**
 * @Description: 目录清单
 * @ClassName: com.xframe.domain.e3sp.basedata.Catalog
 * @Author: lmx
 * @CreateTime: 2024/01/02
 **/
@Data
@Accessors(chain=true)
@XTable(value = "p_t02_catalog", label = "目录清单")
@XSelectItem(keyName = "catalogId",codeName = "catalogId",textName = "sparePartId")
@XBelongsTo(typeName = "com.xframe.domain.e3sp.basedata.Pc",foreignKey = "pcId", targetKey = "pcId",as = "refPc")
@XBelongsTo(typeName = "com.xframe.domain.e3sp.basedata.Section",foreignKey = "sectionId", targetKey = "sectionId",as = "refSection")
@XBelongsTo(typeName = "com.xframe.domain.e3sp.maindata.SparePartBaseView",foreignKey = "sparePartId", targetKey = "sparePartId",as = "refSparePartBaseView")
@XBelongsTo(typeName = "com.xframe.domain.e3sp.basedata.Variety",foreignKey = "varietyId", targetKey = "varietyId",as = "refVariety")
public class Catalog extends BaseModel {
    /**
     * 目录清单ID
     */
    @AutoFill(AutoFillType.Snowflake)
    @XColumn(primaryKeyFlag = true,desc = "目录清单ID")
    private Long catalogId;

    /**
     * 备件ID
     */
    @XQueryCondition
    @XColumn(desc = "备件ID")
    private Long sparePartId;
    /**
     * PCID
     */
    @XQueryCondition
    @XColumn(desc = "PCID")
    private Long pcId;

    /**
     * 节号ID
     */
    @XQueryCondition
    @XColumn(desc = "节号ID")
    private Long sectionId;



    /**
     * 品种ID
     */
    @XQueryCondition
    @XColumn(desc = "品种ID")
    private Long varietyId;


    /**
     * 索引号
     */
    @XQueryCondition
    @XColumn(desc = "索引号",length = 50,nullFlag = true)
    @XGridTableRef
    private String indexNo;

    /**
     * SPECODE
     */
    @XQueryCondition
    @XColumn(desc = "SPECODE",length = 50,nullFlag = true)
    @XGridTableRef
    private String speCode;

    /**
     * 排序码
     */
    @XColumn(desc = "排序码",length = 50,nullFlag = true)
    private String orderNo;

    /**
     * 启用年月
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @XColumn(desc = "启用年月",nullFlag = true)
    private Date actTime;

    /**
     * 停用年月
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @XColumn(desc = "停用年月",nullFlag = true)
    private Date stopTime;

    /**
     * 数量
     */
    @XQueryCondition
    @XColumn(desc = "数量",nullFlag = true)
    private Integer qty;

    /**
     * 说明
     */
    @XQueryCondition
    @XColumn(desc = "说明",length = 500,nullFlag = true)
    @XGridTableRef
    private String illustrate;

    /**
     * 依据
     */
    @XQueryCondition
    @XColumn(desc = "依据",length = 200,nullFlag = true)
    @XGridTableRef
    private String according;

    /**
     * 技术摘要
     */
    @XQueryCondition
    @XColumn(desc = "技术摘要",length = 200,nullFlag = true)
    @XGridTableRef
    private String summary;

    /**
     * 发文号
     */
    @XQueryCondition
    @XColumn(desc = "发文号",length = 50,nullFlag = true)
    @XGridTableRef
    private String docNumber;


    /**
     * 备注
     */
    @XColumn(name = "remark",desc = "备注",length = 500,nullFlag = true)
    private String remark;

    private Pc refPc;

    private Section refSection;

    private SparePartBaseView refSparePartBaseView;

    private Variety refVariety;
}
